package com.sugon.springboot.config;

import com.alibaba.nacos.api.PropertyKeyConst;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.Properties;

@Slf4j
@Component
@Data
@ConfigurationProperties(prefix = "spring.cloud.nacos.discovery")
public class GateWayNacosConfig {

    private String serverAddr;
    private String namespace;
    private String group;
    private String dataId;
    private String username;
    private String password;
    private long timeout;

    public Properties getRouteProperties() {
        Properties properties = new Properties();
        properties.put(PropertyKeyConst.SERVER_ADDR, this.serverAddr);
        properties.put(PropertyKeyConst.NAMESPACE, this.namespace);
        properties.put(PropertyKeyConst.USERNAME, this.username);
        properties.put(PropertyKeyConst.PASSWORD, this.password);
        System.out.print("password"+properties);
        return properties;
    }
}
